home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- *
- * NSSDC/CDF Header file for WFL.
- *
- * Version 1.3, 4-Mar-92, ST Systems (STX)
- *
- * Modification history:
- *
- * V1.0 24-Jan-91, D Grogan/H Leckner Original version (for CDF V2.0).
- * V1.1 25-Mar-91, J Love Remove include of stdlib.h
- * V1.2 11-Sep-91, J Love Modified for IBM-PC port.
- * V1.3 4-Mar-92, H Leckner IBM PC port. CDF V2.2.
- * J Love
- *
- ******************************************************************************/
-
- #include <stdio.h>
- #include "window.h"
-
- #if defined(vms) | defined(__MSDOS__)
- typedef int (*CFP)(int *, int *, int *);
- #endif
- #if defined(unix)
- typedef int (*CFP)();
- #endif
- /*CodeRef-mark*/
- #define SCREEN_WIDTH 80
- #define SCREEN_HEIGHT 22
-
- #ifdef vms
- #define ROW_OFFSET 0
- #define COL_OFFSET 0
- #define MIN_ROW 2
- #endif
-
- #if defined(unix) | defined(ultrix) | defined(__MSDOS__)
- #define ROW_OFFSET 2
- #define COL_OFFSET 2
- #define MIN_ROW 0
- #endif
-
- /*
- * Data types recognized for use in input forms.
- */
-
- #define DT_CHAR 1
- #define DT_STRING 2
- #define DT_SHORTINT 3
- #define DT_LONGINT 4
- #define DT_FLOAT 5
- #define DT_DOUBLE 6
-
- /*
- * Constants for struct form_element_struct.type
- * These declare the type of form, not a data type.
- */
- #define DUMMY_FORM 0L
- #define NO_CALLBACK 1L
- #define MENU_CALLBACK 2L
- #define FORM_CALLBACK 3L
-
- /*
- * fundamental WFL structures
- */
-
- struct window_struct
- {
- WINDOWid wind_id;
- int start_row;
- int start_col;
- int num_rows;
- int num_cols;
- char label[SCREEN_WIDTH * 2];
- };
-
- struct menu_element_struct
- {
- int start_row;
- int start_col;
- char label[SCREEN_WIDTH * 2];
- };
-
- struct form_element_struct
- {
- int start_row;
- int start_col;
- char label[SCREEN_WIDTH * 2];
- int length_label;
- int length_field;
- int type;
- char *popup;
- CFP callback;
- };
-
-
- /*
- * A union structure that overlays all types for
- * output interpretation.
- * (This struct and method taken from CDF Tool Kit.)
- */
-
- union ALLTYPES
- {
- short int2;
- long int4;
- float real4;
- double real8;
- char byte[1024];
- };
- #if !defined(unix)
- void WFL_init(void);
- void WFL_close(void);
- void WFL_message_init(struct window_struct *mess_ptr);
- void WFL_message_display (struct window_struct *c,
- char message[], int beep);
- void WFL_begin_screen_update (void);
- void WFL_end_screen_update (void);
- void WFL_create_window( struct window_struct *c);
- void WFL_delete_window(struct window_struct *c);
- void WFL_draw_window (struct window_struct *window_ptr);
- void WFL_erase_window (struct window_struct *window_ptr);
- void WFL_erase_display (struct window_struct *window_ptr);
- void WFL_begin_display_update (struct window_struct *window_ptr);
- void WFL_end_display_update (struct window_struct *window_ptr);
- #if !defined(vms)
- void WFL_end_display_update_nobox(struct window_struct *window_ptr);
- #endif
- void WFL_change_window_length ( struct window_struct *c, int length);
- void WFL_change_window_width ( struct window_struct *c, int width);
- void WFL_change_window_loc ( struct window_struct *c, int x, int y);
- void WFL_menu_element (char data_ptr[],
- struct menu_element_struct *element_ptr[],
- int num_elements, int *number, int *rcode);
- void WFL_menu_string (int index, struct menu_element_struct *element_ptr[],
- char string[]);
- void WFL_load_menu (struct menu_element_struct *element_ptr[],
- int num_elements, struct window_struct *window_ptr,
- int rowOffset, int colOffset);
- long int WFL_read_menu (struct menu_element_struct *element_ptr[],
- int num_elements,
- struct window_struct *window_ptr,
- int *menu_choice, int *windowHead, int highlight);
- long int WFL_new_dyna_window (struct window_struct **window,
- char *banner);
- void WFL_delete_dyna_window (struct window_struct *window);
- void WFL_set_dyna_window (int startRow, int startCol, int maxRows,
- char *element_list[], struct window_struct *window);
- long int WFL_new_dyna_elem_list (
- struct menu_element_struct *menu_element_ptr[],
- char *element_list[]);
- struct menu_element_struct **WFL_new_dyna_menu (char *element_list[]);
- void WFL_delete_dyna_menu (struct menu_element_struct **ptr,
- char *element_list[]);
- int WFL_popup_menu ( int startRow, int startCol,
- int maxRows,
- char *banner, char *element_list[],
- long int *user_selection, int menu_id,
- int highlight);
- void WFL_load_form (struct form_element_struct *element_ptr[],
- int num_elements, struct window_struct *window_ptr);
- long int WFL_rove_form (int keyboard_code, int *current_element,
- int lo, int hi, int increment);
- void WFL_generic_form (struct window_struct *window_ptr,
- struct form_element_struct *element_ptr[],
- char label[], int data_len);
- void WFL_display_form_data (struct window_struct *window_ptr,
- struct form_element_struct *element_ptr[],
- int *data, int data_type,
- int element_num, int video_type);
- void WFL_read_element ( struct window_struct *window_ptr,
- struct form_element_struct *element_ptr[],
- int *data, int data_type,
- int element_num, int *rcode);
- void WFL_create_popup (struct window_struct **c);
- void WFL_set_popup_window (struct window_struct *window_ptr,
- struct window_struct *parent_ptr,
- struct form_element_struct *element_ptr[],
- int element_num, int num_elements);
- void WFL_popup_connect ( struct form_element_struct *element_ptr[],
- int element_num, int *context_ptr, CFP callback_ptr);
- void WFL_get_popup_pointer (struct form_element_struct *element_ptr[],
- int element_num, int **context_ptr);
- void WFL_read_callback(CFP callback_ptr, int *popup, int *data, int *rcode);
- long int WFL_popup_info ( int startRow, int startCol, int maxRows,
- char *banner, char *element_list[],
- struct window_struct **window_ptr);
- void WFL_put_dyna_info (struct window_struct *window_ptr,
- char *element_list[]);
- #else
- void WFL_init();
- void WFL_close();
- void WFL_message_init();
- void WFL_message_display ();
- void WFL_begin_screen_update ();
- void WFL_end_screen_update ();
- void WFL_create_window();
- void WFL_delete_window();
- void WFL_draw_window ();
- void WFL_erase_window ();
- void WFL_erase_display ();
- void WFL_begin_display_update ();
- void WFL_end_display_update ();
- void WFL_end_display_update_nobox();
- void WFL_change_window_length ();
- void WFL_change_window_width ();
- void WFL_change_window_loc ();
- void WFL_menu_element ();
- void WFL_menu_string ();
- void WFL_load_menu ();
- long int WFL_read_menu ();
- long int WFL_new_dyna_window ();
- void WFL_delete_dyna_window ();
- void WFL_set_dyna_window ();
- long int WFL_new_dyna_elem_list ();
- struct menu_element_struct **WFL_new_dyna_menu ();
- void WFL_delete_dyna_menu ();
- int WFL_popup_menu ();
- void WFL_load_form ();
- long int WFL_rove_form ();
- void WFL_generic_form ();
- void WFL_display_form_data ();
- void WFL_read_element ();
- void WFL_create_popup ();
- void WFL_set_popup_window ();
- void WFL_popup_connect ();
- void WFL_get_popup_pointer ();
- void WFL_read_callback();
- long int WFL_popup_info ();
- void WFL_put_dyna_info ();
- #endif
-
-
-